# This file is part of BlackArch Linux ( https://www.blackarch.org/ ).
# See COPYING for license details.

pkgname=osslsigncode
pkgver=699.c23f92c
pkgrel=1
pkgdesc='A small tool that implements part of the functionality of the Microsoft tool signtool.exe.'
arch=('x86_64' 'aarch64')
groups=('blackarch' 'blackarch-windows' 'blackarch-binary'
        'blackarch-automation')
url='https://github.com/mtrojnar/osslsigncode'
license=('GPL3')
if [[ $CARCH == "aarch64" ]]; then
  depends=('gcc' 'make' 'automake' 'autoconf' 'libtool' 'openssl'
           'libcurl-gnutls')
else
  depends=('gcc' 'make' 'automake' 'autoconf' 'libtool' 'openssl'
           'lib32-libcurl-gnutls')
fi
makedepends=('git' 'cmake')
source=("git+https://github.com/mtrojnar/$pkgname.git")
sha512sums=('SKIP')

pkgver() {
  cd $pkgname

  echo $(git rev-list --count HEAD).$(git rev-parse --short HEAD)
}

build() {
  cd $pkgname

  cmake . \
    -DCMAKE_INSTALL_PREFIX=/usr
}

package() {
  cd $pkgname

  make DESTDIR="$pkgdir" install

  install -Dm 644 -t "$pkgdir/usr/share/doc/$pkgname/" *.md
  install -Dm 644 LICENSE.txt "$pkgdir/usr/share/licenses/$pkgname/LICENSE"
}

